﻿@model SPagedList<Dyd.BaseService.ServiceCenter.Domain.Model.tb_node>
<table style="width:100%;" class="hover2" cellspacing="0" cellspadding="0" border="0">
    <tr>
        <th style="width: 2%">@Html.DisplayNameFor(model => model.id)</th>
        <th style="width: 5%">@Html.DisplayNameFor(model => model.servicenamespace)</th>
        <th style="width: 5%">@Html.DisplayNameFor(model => model.ip)</th>
        <th style="width: 4%">@Html.DisplayNameFor(model => model.port)</th>
        <th style="width: 5%">@Html.DisplayNameFor(model => model.runstate)</th>
        <th style="width: 12%">@Html.DisplayNameFor(model => model.nodeheartbeattime)</th>
        <th style="width: 5%">@Html.DisplayNameFor(model => model.boostpercent)</th>
        <th style="width: 5%">@Html.DisplayNameFor(model => model.errorcount)</th>
        <th style="width: 6%">@Html.DisplayNameFor(model => model.visitcount)</th>
        <th style="width: 8%">@Html.DisplayNameFor(model => model.connectioncount)</th>
        <th style="width: 5%">@Html.DisplayNameFor(model => model.processthreadcount)</th>
        <th style="width: 5%">@Html.DisplayNameFor(model => model.processcpuper)</th>
        <th style="width: 6%">@Html.DisplayNameFor(model => model.memorysize)</th>
        <th style="width: 5%">@Html.DisplayNameFor(model => model.filesize)</th>
        <th style="width: 14%">操作</th>
    </tr>

    @foreach (var item in Model)
    {
        <tr data-id="@item.id">
            <td>
                @item.id
            </td>
            <td>
                @item.servicenamespace
            </td>
            <td>
                @item.ip
            </td>
            <td>
                @item.port
            </td>
            <td>
                @(XXF.ProjectTool.EnumHelper<XXF.BaseService.ServiceCenter.SystemRuntime.EnumRunState>.GetText(item.runstate))
            </td>
            <td>
                @item.nodeheartbeattime
            </td>
            <td>
                <input id="boostpercent@(item.id)" name="boostpercent" type="text" value="@item.boostpercent" class="w80" onchange="changeBoostPercent('@item.id')" />
            </td>
            <td>
                @item.errorcount
            </td>
            <td>
                @item.visitcount
            </td>
            <td>
                @item.connectioncount
            </td>
            <td>
                @item.processthreadcount
            </td>

            <td>
                @item.processcpuper.ToString("N3")
            </td>
            <td>
                @(item.memorysize.ToString("N2") + "M")
            </td>
            <td>
                @item.filesize
            </td>
            <td>
                <a class="btn w80" data-operate="restartNode" href="#">重启</a>
                <a class="setDefaultProtocol btn w80" data-operate="setDefaultProtocol" href="#">设为标志协议</a>
                <a data-title="@item.protocoljson" class="showProtocolJson btn w80" data-operate="showProtocolJson" href="#">查看协议Json</a>
                <a class="showReport btn w50" data-operate="showReport" href="#">查看报表</a>
                @if ((int)XXF.BaseService.ServiceCenter.SystemRuntime.EnumRunState.Stop == item.runstate)
                {
                    <a class="deleteItem btn w50" data-operate="deleteItem" href="#">删除</a>
                }
            </td>
        </tr>
    }
</table>
<div class="pagination">
    <div class="total fl">共<em>@Model.TotalItemCount</em>条记录</div>
    <div class="pagination-pages">
        @Html.SPager(Model, "pno", "pager_page", "#ajaxList", "#ajaxForm")
    </div>
</div>